<template>
  <div class="resultDetails">
    <div class="resultDetails_nav">
      <p style="margin-right: 20px">学科简介</p>
    </div>
    <div class="resultDetails_content">
      <h1>{{ resultDetailsData.title }}</h1>
      <p class="resultDetails_content_time">
        发布时间：{{ resultDetailsData.createdAt }}
      </p>
      <div class="resultDetails_content_paragraph">
        <p v-html="resultDetailsData.content"></p>
      </div>
    </div>
  </div>
</template>

<script>
import { findResearchById } from "@/api/research";
export default {
  name: "resultDetails",
  data() {
    return {
      resultDetailsData: {},
    };
  },
  created() {},
  mounted() {
    this.findResearchById();
  },
  methods: {
    findResearchById() {
      findResearchById(this.$route.query.currentId).then(response => {
        if (response.data.code === 20000) {
          const { createdAt, title, content } = response.data.results;
          this.resultDetailsData = {
            createdAt,
            title,
            content,
          };
        }
      });
    },
  },
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.resultDetails {
  color: #333;
  .resultDetails_nav {
    height: 40px;
    background: #f1f1f1;
    text-align: right;
    line-height: 40px;
    font-weight: bold;
    font-size: 21px;
    color: #0a7b19;
  }
  .resultDetails_content {
    margin-top: 40px;
    margin-bottom: 110px;
    h1 {
      width: 100%;
      text-align: center;
    }
    .resultDetails_content_time {
      margin-top: 25px;
      font-size: 12px;
      width: 100%;
      text-align: center;
    }
    .resultDetails_content_paragraph {
      margin-top: 30px;
      font-size: 14px;
      line-height: 24px;
    }
  }
}
</style>
